#!/usr/bin/env python3
"""
ESP32 Arduino风格控制库安装脚本
"""

from setuptools import setup, find_packages
import os

# 读取README文件
def read_readme():
    with open("README.md", "r", encoding="utf-8") as fh:
        return fh.read()

# 读取requirements
def read_requirements():
    with open("requirements.txt", "r", encoding="utf-8") as fh:
        return [line.strip() for line in fh if line.strip() and not line.startswith("#")]

setup(
    name="esp32-arduino-python",
    version="1.0.0",
    author="王海涛",
    author_email="haitaowang926@gmail.com",
    description="Arduino风格的ESP32 Python控制库",
    long_description=read_readme(),
    long_description_content_type="text/markdown",
    url="https://gitee.com/haitaowang926/esp32-arduino-python",
    packages=find_packages(),
    classifiers=[
        "Development Status :: 4 - Beta",
        "Intended Audience :: Developers",
        "License :: OSI Approved :: MIT License",
        "Operating System :: POSIX :: Linux",
        "Programming Language :: Python :: 3",
        "Programming Language :: Python :: 3.7",
        "Programming Language :: Python :: 3.8",
        "Programming Language :: Python :: 3.9",
        "Programming Language :: Python :: 3.10",
        "Topic :: Software Development :: Libraries :: Python Modules",
        "Topic :: System :: Hardware",
        "Topic :: Scientific/Engineering",
    ],
    python_requires=">=3.7",
    install_requires=read_requirements(),
    extras_require={
        "dev": [
            "pytest>=6.0",
            "black>=21.0",
            "flake8>=3.8",
        ],
    },
    entry_points={
        "console_scripts": [
            "esp32-test=esp32_arduino.examples.test:main",
        ],
    },
    include_package_data=True,
    package_data={
        "esp32_arduino": ["examples/*.py"],
    },
    keywords="esp32 arduino python iot embedded hardware",
    project_urls={
        "Bug Reports": "https://gitee.com/haitaowang926/esp32-arduino-python/issues",
        "Source": "https://gitee.com/haitaowang926/esp32-arduino-python",
        "Documentation": "https://gitee.com/haitaowang926/esp32-arduino-python/blob/master/README.md",
    },
)